3.11.46 \(\int (a+i a \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx\) [1046]

Optimal. Leaf size=26 \[ \frac {i a (c-i c \tan (e+f x))^n}{f n} \]

[Out]

I*a*(c-I*c*tan(f*x+e))^n/f/n

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {3603, 3568, 32} \begin {gather*} \frac {i a (c-i c \tan (e+f x))^n}{f n} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n,x]

[Out]

(I*a*(c - I*c*Tan[e + f*x])^n)/(f*n)

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx &=(a c) \int \sec ^2(e+f x) (c-i c \tan (e+f x))^{-1+n} \, dx\\ &=\frac {(i a) \text {Subst}\left (\int (c+x)^{-1+n} \, dx,x,-i c \tan (e+f x)\right )}{f}\\ &=\frac {i a (c-i c \tan (e+f x))^n}{f n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.42, size = 51, normalized size = 1.96 \begin {gather*} \frac {i a e^{n (-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} (c \sec (e+f x))^n}{f n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n,x]

[Out]

(I*a*E^(n*(-Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*(c*Sec[e + f*x])^n)/(f*n)

________________________________________________________________________________________

Maple [A]
time = 0.22, size = 25, normalized size = 0.96

method result size
derivativedivides \(\frac {i a \left (c -i c \tan \left (f x +e \right )\right )^{n}}{f n}\) \(25\)
default \(\frac {i a \left (c -i c \tan \left (f x +e \right )\right )^{n}}{f n}\) \(25\)
norman \(\frac {i a \,{\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f n}\) \(27\)
risch \(\frac {i a \,{\mathrm e}^{\frac {n \left (-i \pi \mathrm {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{3}+i \pi \mathrm {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \mathrm {csgn}\left (i c \right )+i \pi \mathrm {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )-i \pi \,\mathrm {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )-2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )+2 \ln \left (2\right )+2 \ln \left (c \right )\right )}{2}}}{f n}\) \(176\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x,method=_RETURNVERBOSE)

[Out]

I*a*(c-I*c*tan(f*x+e))^n/f/n

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 25, normalized size = 0.96 \begin {gather*} \frac {i \, a c^{n} {\left (-i \, \tan \left (f x + e\right ) + 1\right )}^{n}}{f n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="maxima")

[Out]

I*a*c^n*(-I*tan(f*x + e) + 1)^n/(f*n)

________________________________________________________________________________________

Fricas [A]
time = 1.17, size = 28, normalized size = 1.08 \begin {gather*} \frac {i \, a \left (\frac {2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="fricas")

[Out]

I*a*(2*c/(e^(2*I*f*x + 2*I*e) + 1))^n/(f*n)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (19) = 38\).
time = 0.21, size = 70, normalized size = 2.69 \begin {gather*} \begin {cases} x \left (i a \tan {\left (e \right )} + a\right ) & \text {for}\: f = 0 \wedge n = 0 \\a x + \frac {i a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} & \text {for}\: n = 0 \\x \left (i a \tan {\left (e \right )} + a\right ) \left (- i c \tan {\left (e \right )} + c\right )^{n} & \text {for}\: f = 0 \\\frac {i a \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{f n} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c-I*c*tan(f*x+e))**n,x)

[Out]

Piecewise((x*(I*a*tan(e) + a), Eq(f, 0) & Eq(n, 0)), (a*x + I*a*log(tan(e + f*x)**2 + 1)/(2*f), Eq(n, 0)), (x*
(I*a*tan(e) + a)*(-I*c*tan(e) + c)**n, Eq(f, 0)), (I*a*(-I*c*tan(e + f*x) + c)**n/(f*n), True))

________________________________________________________________________________________

Giac [A]
time = 1.22, size = 23, normalized size = 0.88 \begin {gather*} \frac {i \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n} a}{f n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="giac")

[Out]

I*(-I*c*tan(f*x + e) + c)^n*a/(f*n)

________________________________________________________________________________________

Mupad [B]
time = 4.86, size = 40, normalized size = 1.54 \begin {gather*} \frac {a\,{\left (\frac {2\,c}{\cos \left (2\,e+2\,f\,x\right )+1+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}}\right )}^n\,1{}\mathrm {i}}{f\,n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)*(c - c*tan(e + f*x)*1i)^n,x)

[Out]

(a*((2*c)/(cos(2*e + 2*f*x) + sin(2*e + 2*f*x)*1i + 1))^n*1i)/(f*n)

________________________________________________________________________________________